package com.tornainbow;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author mcrysler
 */
public class FlowTerminator extends Processor {
    // Define a logger for this class
    private static Logger logger = LoggerFactory.getLogger(FlowTerminator.class);
    
    /**
     * Set the properties for this class
     */
    public FlowTerminator() {
        super();
    }
    
    @Override
    public String getProcessorName() {
        return (this.getClass().getName() + " : " + this.getName());
    }
    
    @Override
    public void run() {
        // Loop indefinitely waiting for new messages
        for (;;) {
            // Wait to receive a new message
            Consumer.receive(this.getProperty(PROP_JMS_URL), this.getProperty(PROP_JMS_SOURCE_QUEUE_NAME));
            logger.info("Received message from queue {}", this.getProperty(PROP_JMS_SOURCE_QUEUE_NAME));
        }
    }
}
